package com.dayu.tcp.listener;

import com.dayu.tcp.service.WrappedChannel;
import io.netty.channel.ChannelHandlerContext;

import java.util.EventListener;

/**
 * @author yehangtech
 * @date 2024/4/3
 * @description 通道事件监听器
 */
public interface ChannelEventListener extends EventListener {

    /**
     * 通道连接
     *
     * @param ctx
     * @param channel
     * @return EventBehavior
     */
    EventBehavior channelActive(ChannelHandlerContext ctx, WrappedChannel channel);

    /**
     * 通道关闭
     *
     * @param ctx
     * @param channel
     * @return EventBehavior
     */
    EventBehavior channelInActive(ChannelHandlerContext ctx, WrappedChannel channel);
}
